package com.dd.web.base.entity.data;

import com.dd.web.base.entity.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Delegate;

import java.io.Serializable;
import java.util.Date;
import java.util.List;


@Getter
@Setter
@ApiModel(description="菜单")
public class UmsMenu extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("菜单ID")
    private Long id;

    @ApiModelProperty("菜单名称")
    private String menuName ;

    @ApiModelProperty("父菜单ID")
    private Long parentId ;
    @ApiModelProperty("显示顺序")
    private int orderNum;
    @ApiModelProperty("路由地址")
    private String path;
    @ApiModelProperty("组件路径")
    private String component;
    @ApiModelProperty("是否为外链（1是 2否）")
    private int frame;
    @ApiModelProperty("菜单类型（M目录 C菜单 F按钮）")
    private String menuType;
    @ApiModelProperty("菜单是否显示（1显示 2隐藏）")
    private int visible;
    @ApiModelProperty("菜单状态（1正常 2停用）")
    private int status;
    @ApiModelProperty("权限标识")
    private String perms;
    @ApiModelProperty("菜单图标")
    private String icon ;
    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("父菜单")
    private UmsMenu parentMenu;

    /**
     * 子节点集合
     */
    private List<UmsMenu> childrenMenuList;

    /**
     * 是否包含子菜单
     */
    private boolean hasChild;


    /**
     * 节点搜索关键字
     */
    private String searchkey;

//    /**
//     * 父菜单名称
//     */
//    private String parentMenuName;

    public String getParentMenuName(){
        if (this.parentMenu != null){
            return this.parentMenu.getMenuName();
        }
        return "";
    }

}
